<ion-view hide-back-button="true" title="注册">
  <ion-nav-buttons side="left">
    <button class="button button-clear" ng-click="backClicked()" side="primary">
      <i class="icon ion-chevron-left"></i>
    </button>
  </ion-nav-buttons>
  <ion-content>
    <div class="container" ng-show="state == 0">
      <div class="list">
        <label class="item item-input main-input">
          <span class="input-label">+86</span>
          <input name="phone" ng-model="phone" placeholder="手机号码" type="text">
        </label>
      </div>

      <div style="height: 80px"></div>

      <button class="button button-block main-background" ng-click="getCode()" ng-disabled="phone.length != 11 || !phoneRegCheck" style="border-radius: 10px">
        获取短信验证码
      </button>
      <ul class="list">
        <li class="item item-checkbox item-text-wrap select-all" style="font-size: 13px; background-color: #eee">
          <label class="checkbox">
            <input ng-model="phoneRegCheck" type="checkbox">
          </label>
          我已阅读并接受
          <span class="main-color">小区快驹用户服务协议</span>
        </li>
      </ul>
    </div>

    <div class="container" ng-show="state == 1">
      <div style="color: #5a5a5a; margin-top: 20px">已发送验证码至{{phone}}</div>
      <div class="list no-padding row">
        <label class="item item-input col-60 main-input">
          <input ng-model="phonecode" placeholder="请输入手机验证码" type="text"/>
        </label>
        <button class="col button main-background" href="" ng-click="getCdoe()" ng-disabled="timecount > 0" style="font-size: 15px;padding: 0px; border-radius: 8px;  height: 40px; margin-top: 10px; margin-left: 2px;">重新发送
          <span ng-if="timecount > 0">{{timecount}}s</span>
        </button>
      </div>

      <div style="height: 50px"></div>

      <button class="button button-block main-background" ng-click="checkCode()" ng-disabled="!phonecode || phonecode.length != 4 || !agree2" style="border-radius: 10px">
        验证
      </button>
      <ul class="list">
        <li class="item item-checkbox item-text-wrap select-all" style="font-size: 13px; background-color: #eee">
          <label class="checkbox">
            <input ng-model="agree2" type="checkbox"/>
          </label>
          我已阅读并接受
          <span class="main-color">小区快驹用户服务协议</span>
        </li>
      </ul>
    </div>

    <div class="container" ng-show="state == 2">
      <div class="list">
        <label class="item item-input main-input">
          <input ng-model="pwd" placeholder="设置6-12位密码" type="password">
        </label>
        <label class="item item-input main-input">
          <input ng-model="testpwd" placeholder="请再次输入密码" type="password">
        </label>
      </div>

      <div style="height: 80px"></div>

      <button class="button button-block main-background" ng-click="setPwd()" ng-disabled="!pwd || pwd.length < 6 || pwd.length > 12 || pwd != testpwd" style="border-radius: 10px">
        完成注册
      </button>
    </div>
  </ion-content>
</ion-view>
